{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 03: Generate counts\n",
    "\n",
    "This script takes a directory of `.csv` files containing entity counts by month in the following format:\n",
    "\n",
    "```csv\n",
    ",2012-01,2012-02\n",
    "meat,1011.0,873.0\n",
    "salt,805.0,897.0\n",
    "chicken,694.0,713.0\n",
    "```\n",
    "\n",
    "It sums the counts from all files, only keeps the `N` most common records and calculates the variance, scaled by the average. This helps select a more \"interesting\" subset of entities with the most variance over time. The result are the most variant entities (minus the most frequent, which tend to be less interesting). The result can be used to create an interactive [bar chart race visualization](https://public.flourish.studio/visualisation/1532208/). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "INPUT_DIR = \"./counts\"               # directory of counts file(s) created in the previous step\n",
    "OUTPUT_FILE = \"./output_counts.csv\"  # path to output file\n",
    "MOST_COMMON = 10_000                 # number of most common entities to keep\n",
    "DROP_MOST_FREQUENT = 10              # number of most frequent entities to drop\n",
    "N_TOTAL = 50                         # number of results to export"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "import csv\n",
    "from collections import Counter, defaultdict\n",
    "from pathlib import Path\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_csv(file_):\n",
    "    counts = Counter()\n",
    "    for row in csv.DictReader(file_):\n",
    "        term = row[\"\"]\n",
    "        for year, freq in row.items():\n",
    "            if year != \"\" and freq:\n",
    "                counts[(term, year)] = int(float(freq))\n",
    "    return counts\n",
    "\n",
    "\n",
    "def prune_rows(counts_by_term, n):\n",
    "    totals = Counter()\n",
    "    for term, counts in counts_by_term.items():\n",
    "        if \"Total\" in counts:\n",
    "            total = counts[\"Total\"]\n",
    "        else:\n",
    "            total = sum(counts.values())\n",
    "        totals[term] = total\n",
    "    pruned = defaultdict(dict)\n",
    "    for term, _ in totals.most_common(n):\n",
    "        pruned[term] = counts_by_term[term]\n",
    "    return pruned\n",
    "\n",
    "\n",
    "def sum_counts(directory, n=10000):\n",
    "    directory = Path(directory)\n",
    "    counts = Counter()\n",
    "    for path in directory.glob(\"**/*.csv\"):\n",
    "        with path.open(\"r\", encoding=\"utf8\") as file_:\n",
    "            counts.update(read_csv(file_))\n",
    "    by_term = defaultdict(Counter)\n",
    "    for (term, month), freq in counts.items():\n",
    "        by_term[term][month] = freq\n",
    "    records = prune_rows(by_term, n)\n",
    "    months = set()\n",
    "    for term, counts in records.items():\n",
    "        months.update(counts.keys())\n",
    "    fields = [\"Term\"] + list(sorted(months))\n",
    "    rows = []\n",
    "    for term, month_freqs in records.items():\n",
    "        month_freqs[\"Term\"] = term\n",
    "        for month in months:\n",
    "            month_freqs.setdefault(month, 0.0)\n",
    "        rows.append(month_freqs)\n",
    "    return pd.DataFrame.from_records(rows, index=\"Term\", columns=fields)\n",
    "\n",
    "\n",
    "def sort_by_frequency(df):\n",
    "    most_common = df.sum(axis=1)\n",
    "    most_common.sort_values(ascending=False, inplace=True)\n",
    "    return df.loc[most_common.index]\n",
    "\n",
    "\n",
    "def drop_most_frequent(df, n):\n",
    "    return sort_by_frequency(df)[n:]\n",
    "\n",
    "\n",
    "def get_most_variant(df, n, mean_weight=False):\n",
    "    cvars = df.var(axis=1)\n",
    "    if mean_weight:\n",
    "        cvars = cvars / df.mean(axis=1)\n",
    "    cvars = cvars.sort_values(ascending=False)\n",
    "    return df.loc[cvars.index][:n]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2012-01</th>\n",
       "      <th>2012-02</th>\n",
       "      <th>2012-03</th>\n",
       "      <th>2012-04</th>\n",
       "      <th>2012-05</th>\n",
       "      <th>2012-06</th>\n",
       "      <th>2012-07</th>\n",
       "      <th>2012-08</th>\n",
       "      <th>2012-09</th>\n",
       "      <th>2012-10</th>\n",
       "      <th>...</th>\n",
       "      <th>2018-10</th>\n",
       "      <th>2018-11</th>\n",
       "      <th>2018-12</th>\n",
       "      <th>2019-01</th>\n",
       "      <th>2019-02</th>\n",
       "      <th>2019-03</th>\n",
       "      <th>2019-04</th>\n",
       "      <th>2019-05</th>\n",
       "      <th>2019-06</th>\n",
       "      <th>2019-07</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Term</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>salt</th>\n",
       "      <td>805</td>\n",
       "      <td>897</td>\n",
       "      <td>271</td>\n",
       "      <td>664</td>\n",
       "      <td>690</td>\n",
       "      <td>787</td>\n",
       "      <td>718</td>\n",
       "      <td>661</td>\n",
       "      <td>805</td>\n",
       "      <td>1165</td>\n",
       "      <td>...</td>\n",
       "      <td>2202</td>\n",
       "      <td>2209</td>\n",
       "      <td>2456</td>\n",
       "      <td>3093</td>\n",
       "      <td>2606</td>\n",
       "      <td>2460</td>\n",
       "      <td>2441</td>\n",
       "      <td>2798</td>\n",
       "      <td>2061</td>\n",
       "      <td>3372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>meat</th>\n",
       "      <td>1011</td>\n",
       "      <td>873</td>\n",
       "      <td>305</td>\n",
       "      <td>614</td>\n",
       "      <td>771</td>\n",
       "      <td>655</td>\n",
       "      <td>704</td>\n",
       "      <td>834</td>\n",
       "      <td>655</td>\n",
       "      <td>1020</td>\n",
       "      <td>...</td>\n",
       "      <td>1825</td>\n",
       "      <td>1746</td>\n",
       "      <td>2427</td>\n",
       "      <td>2942</td>\n",
       "      <td>2109</td>\n",
       "      <td>2025</td>\n",
       "      <td>2437</td>\n",
       "      <td>2234</td>\n",
       "      <td>1936</td>\n",
       "      <td>3379</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>chicken</th>\n",
       "      <td>694</td>\n",
       "      <td>713</td>\n",
       "      <td>211</td>\n",
       "      <td>617</td>\n",
       "      <td>534</td>\n",
       "      <td>496</td>\n",
       "      <td>703</td>\n",
       "      <td>623</td>\n",
       "      <td>731</td>\n",
       "      <td>875</td>\n",
       "      <td>...</td>\n",
       "      <td>1768</td>\n",
       "      <td>1508</td>\n",
       "      <td>1840</td>\n",
       "      <td>2595</td>\n",
       "      <td>2057</td>\n",
       "      <td>2201</td>\n",
       "      <td>2023</td>\n",
       "      <td>2331</td>\n",
       "      <td>2069</td>\n",
       "      <td>3213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>garlic</th>\n",
       "      <td>590</td>\n",
       "      <td>679</td>\n",
       "      <td>180</td>\n",
       "      <td>635</td>\n",
       "      <td>501</td>\n",
       "      <td>587</td>\n",
       "      <td>560</td>\n",
       "      <td>600</td>\n",
       "      <td>634</td>\n",
       "      <td>623</td>\n",
       "      <td>...</td>\n",
       "      <td>1369</td>\n",
       "      <td>1577</td>\n",
       "      <td>1895</td>\n",
       "      <td>2585</td>\n",
       "      <td>1949</td>\n",
       "      <td>1830</td>\n",
       "      <td>1816</td>\n",
       "      <td>2137</td>\n",
       "      <td>1518</td>\n",
       "      <td>2510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rice</th>\n",
       "      <td>805</td>\n",
       "      <td>542</td>\n",
       "      <td>219</td>\n",
       "      <td>403</td>\n",
       "      <td>357</td>\n",
       "      <td>467</td>\n",
       "      <td>376</td>\n",
       "      <td>435</td>\n",
       "      <td>367</td>\n",
       "      <td>585</td>\n",
       "      <td>...</td>\n",
       "      <td>2295</td>\n",
       "      <td>1520</td>\n",
       "      <td>1262</td>\n",
       "      <td>2754</td>\n",
       "      <td>2302</td>\n",
       "      <td>1699</td>\n",
       "      <td>2011</td>\n",
       "      <td>2189</td>\n",
       "      <td>1450</td>\n",
       "      <td>2089</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ricers</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wild hog</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cavendish bananas</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>lactaid</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sourdough rye</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 91 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   2012-01  2012-02  2012-03  2012-04  2012-05  2012-06  \\\n",
       "Term                                                                      \n",
       "salt                   805      897      271      664      690      787   \n",
       "meat                  1011      873      305      614      771      655   \n",
       "chicken                694      713      211      617      534      496   \n",
       "garlic                 590      679      180      635      501      587   \n",
       "rice                   805      542      219      403      357      467   \n",
       "...                    ...      ...      ...      ...      ...      ...   \n",
       "ricers                   0        0        0        0        0        0   \n",
       "wild hog                 0        0        0        0        0        0   \n",
       "cavendish bananas        0        0        0        0        0        0   \n",
       "lactaid                  0        0        0        0        0        0   \n",
       "sourdough rye            0        0        0        0        0        0   \n",
       "\n",
       "                   2012-07  2012-08  2012-09  2012-10  ...  2018-10  2018-11  \\\n",
       "Term                                                   ...                     \n",
       "salt                   718      661      805     1165  ...     2202     2209   \n",
       "meat                   704      834      655     1020  ...     1825     1746   \n",
       "chicken                703      623      731      875  ...     1768     1508   \n",
       "garlic                 560      600      634      623  ...     1369     1577   \n",
       "rice                   376      435      367      585  ...     2295     1520   \n",
       "...                    ...      ...      ...      ...  ...      ...      ...   \n",
       "ricers                   0        0        0        0  ...        0        1   \n",
       "wild hog                 0        0        1        0  ...        0        0   \n",
       "cavendish bananas        0        0        0        0  ...        0        2   \n",
       "lactaid                  0        0        0        0  ...        0        1   \n",
       "sourdough rye            0        0        0        0  ...        0        0   \n",
       "\n",
       "                   2018-12  2019-01  2019-02  2019-03  2019-04  2019-05  \\\n",
       "Term                                                                      \n",
       "salt                  2456     3093     2606     2460     2441     2798   \n",
       "meat                  2427     2942     2109     2025     2437     2234   \n",
       "chicken               1840     2595     2057     2201     2023     2331   \n",
       "garlic                1895     2585     1949     1830     1816     2137   \n",
       "rice                  1262     2754     2302     1699     2011     2189   \n",
       "...                    ...      ...      ...      ...      ...      ...   \n",
       "ricers                   0        0        0        0        0        0   \n",
       "wild hog                 0        0        0        0        0        0   \n",
       "cavendish bananas        1        0        0        0        0        0   \n",
       "lactaid                  0        0        0        0        0        0   \n",
       "sourdough rye            0        0        0        0        0        0   \n",
       "\n",
       "                   2019-06  2019-07  \n",
       "Term                                 \n",
       "salt                  2061     3372  \n",
       "meat                  1936     3379  \n",
       "chicken               2069     3213  \n",
       "garlic                1518     2510  \n",
       "rice                  1450     2089  \n",
       "...                    ...      ...  \n",
       "ricers                   0        0  \n",
       "wild hog                 0        1  \n",
       "cavendish bananas        0        0  \n",
       "lactaid                  0        0  \n",
       "sourdough rye            0        2  \n",
       "\n",
       "[10000 rows x 91 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DF = sum_counts(INPUT_DIR, MOST_COMMON)\n",
    "DF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2012-01</th>\n",
       "      <th>2012-02</th>\n",
       "      <th>2012-03</th>\n",
       "      <th>2012-04</th>\n",
       "      <th>2012-05</th>\n",
       "      <th>2012-06</th>\n",
       "      <th>2012-07</th>\n",
       "      <th>2012-08</th>\n",
       "      <th>2012-09</th>\n",
       "      <th>2012-10</th>\n",
       "      <th>...</th>\n",
       "      <th>2018-10</th>\n",
       "      <th>2018-11</th>\n",
       "      <th>2018-12</th>\n",
       "      <th>2019-01</th>\n",
       "      <th>2019-02</th>\n",
       "      <th>2019-03</th>\n",
       "      <th>2019-04</th>\n",
       "      <th>2019-05</th>\n",
       "      <th>2019-06</th>\n",
       "      <th>2019-07</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Term</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>potatoes</th>\n",
       "      <td>343</td>\n",
       "      <td>654</td>\n",
       "      <td>773</td>\n",
       "      <td>963</td>\n",
       "      <td>1194</td>\n",
       "      <td>1402</td>\n",
       "      <td>1610</td>\n",
       "      <td>1905</td>\n",
       "      <td>2168</td>\n",
       "      <td>2568</td>\n",
       "      <td>...</td>\n",
       "      <td>37277</td>\n",
       "      <td>38479</td>\n",
       "      <td>39734</td>\n",
       "      <td>41033</td>\n",
       "      <td>42277</td>\n",
       "      <td>43420</td>\n",
       "      <td>44668</td>\n",
       "      <td>45723</td>\n",
       "      <td>46768</td>\n",
       "      <td>48460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>onions</th>\n",
       "      <td>330</td>\n",
       "      <td>657</td>\n",
       "      <td>796</td>\n",
       "      <td>1076</td>\n",
       "      <td>1540</td>\n",
       "      <td>1850</td>\n",
       "      <td>2201</td>\n",
       "      <td>2510</td>\n",
       "      <td>2829</td>\n",
       "      <td>3176</td>\n",
       "      <td>...</td>\n",
       "      <td>35786</td>\n",
       "      <td>36703</td>\n",
       "      <td>37557</td>\n",
       "      <td>39298</td>\n",
       "      <td>40462</td>\n",
       "      <td>41567</td>\n",
       "      <td>42691</td>\n",
       "      <td>43967</td>\n",
       "      <td>44759</td>\n",
       "      <td>46478</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>bacon</th>\n",
       "      <td>439</td>\n",
       "      <td>799</td>\n",
       "      <td>983</td>\n",
       "      <td>1325</td>\n",
       "      <td>1818</td>\n",
       "      <td>2237</td>\n",
       "      <td>2766</td>\n",
       "      <td>3109</td>\n",
       "      <td>3495</td>\n",
       "      <td>3914</td>\n",
       "      <td>...</td>\n",
       "      <td>35680</td>\n",
       "      <td>36357</td>\n",
       "      <td>37514</td>\n",
       "      <td>38969</td>\n",
       "      <td>39708</td>\n",
       "      <td>40429</td>\n",
       "      <td>41128</td>\n",
       "      <td>42064</td>\n",
       "      <td>42798</td>\n",
       "      <td>43857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pasta</th>\n",
       "      <td>451</td>\n",
       "      <td>679</td>\n",
       "      <td>763</td>\n",
       "      <td>1054</td>\n",
       "      <td>1361</td>\n",
       "      <td>1648</td>\n",
       "      <td>2016</td>\n",
       "      <td>2284</td>\n",
       "      <td>2534</td>\n",
       "      <td>3058</td>\n",
       "      <td>...</td>\n",
       "      <td>33008</td>\n",
       "      <td>34048</td>\n",
       "      <td>35010</td>\n",
       "      <td>36387</td>\n",
       "      <td>37512</td>\n",
       "      <td>38363</td>\n",
       "      <td>39412</td>\n",
       "      <td>40591</td>\n",
       "      <td>41829</td>\n",
       "      <td>43308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>beef</th>\n",
       "      <td>285</td>\n",
       "      <td>631</td>\n",
       "      <td>765</td>\n",
       "      <td>1089</td>\n",
       "      <td>1314</td>\n",
       "      <td>1550</td>\n",
       "      <td>1785</td>\n",
       "      <td>2056</td>\n",
       "      <td>2258</td>\n",
       "      <td>2638</td>\n",
       "      <td>...</td>\n",
       "      <td>30900</td>\n",
       "      <td>31667</td>\n",
       "      <td>32631</td>\n",
       "      <td>33804</td>\n",
       "      <td>34735</td>\n",
       "      <td>35566</td>\n",
       "      <td>36499</td>\n",
       "      <td>37372</td>\n",
       "      <td>38180</td>\n",
       "      <td>39423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>egg</th>\n",
       "      <td>302</td>\n",
       "      <td>566</td>\n",
       "      <td>700</td>\n",
       "      <td>914</td>\n",
       "      <td>1261</td>\n",
       "      <td>1500</td>\n",
       "      <td>1777</td>\n",
       "      <td>2036</td>\n",
       "      <td>2334</td>\n",
       "      <td>2614</td>\n",
       "      <td>...</td>\n",
       "      <td>30880</td>\n",
       "      <td>31433</td>\n",
       "      <td>32313</td>\n",
       "      <td>33304</td>\n",
       "      <td>34125</td>\n",
       "      <td>34921</td>\n",
       "      <td>35955</td>\n",
       "      <td>36997</td>\n",
       "      <td>37758</td>\n",
       "      <td>39253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>olive oil</th>\n",
       "      <td>348</td>\n",
       "      <td>698</td>\n",
       "      <td>796</td>\n",
       "      <td>1108</td>\n",
       "      <td>1433</td>\n",
       "      <td>1759</td>\n",
       "      <td>2097</td>\n",
       "      <td>2399</td>\n",
       "      <td>2713</td>\n",
       "      <td>3045</td>\n",
       "      <td>...</td>\n",
       "      <td>31935</td>\n",
       "      <td>32580</td>\n",
       "      <td>33199</td>\n",
       "      <td>34114</td>\n",
       "      <td>35131</td>\n",
       "      <td>35882</td>\n",
       "      <td>36704</td>\n",
       "      <td>37486</td>\n",
       "      <td>38133</td>\n",
       "      <td>39157</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>onion</th>\n",
       "      <td>307</td>\n",
       "      <td>622</td>\n",
       "      <td>718</td>\n",
       "      <td>957</td>\n",
       "      <td>1296</td>\n",
       "      <td>1589</td>\n",
       "      <td>1862</td>\n",
       "      <td>2130</td>\n",
       "      <td>2433</td>\n",
       "      <td>2818</td>\n",
       "      <td>...</td>\n",
       "      <td>31212</td>\n",
       "      <td>32048</td>\n",
       "      <td>32832</td>\n",
       "      <td>34037</td>\n",
       "      <td>34811</td>\n",
       "      <td>35594</td>\n",
       "      <td>36292</td>\n",
       "      <td>37255</td>\n",
       "      <td>37930</td>\n",
       "      <td>39118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>steak</th>\n",
       "      <td>357</td>\n",
       "      <td>785</td>\n",
       "      <td>915</td>\n",
       "      <td>1235</td>\n",
       "      <td>1485</td>\n",
       "      <td>1701</td>\n",
       "      <td>1967</td>\n",
       "      <td>2339</td>\n",
       "      <td>2591</td>\n",
       "      <td>2935</td>\n",
       "      <td>...</td>\n",
       "      <td>31193</td>\n",
       "      <td>31671</td>\n",
       "      <td>32579</td>\n",
       "      <td>33593</td>\n",
       "      <td>34361</td>\n",
       "      <td>35021</td>\n",
       "      <td>35962</td>\n",
       "      <td>36693</td>\n",
       "      <td>37490</td>\n",
       "      <td>38871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sugar</th>\n",
       "      <td>312</td>\n",
       "      <td>588</td>\n",
       "      <td>730</td>\n",
       "      <td>985</td>\n",
       "      <td>1288</td>\n",
       "      <td>1545</td>\n",
       "      <td>1836</td>\n",
       "      <td>2085</td>\n",
       "      <td>2332</td>\n",
       "      <td>2614</td>\n",
       "      <td>...</td>\n",
       "      <td>30231</td>\n",
       "      <td>30965</td>\n",
       "      <td>31997</td>\n",
       "      <td>32912</td>\n",
       "      <td>33689</td>\n",
       "      <td>34684</td>\n",
       "      <td>35355</td>\n",
       "      <td>36315</td>\n",
       "      <td>37200</td>\n",
       "      <td>38423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>flour</th>\n",
       "      <td>435</td>\n",
       "      <td>765</td>\n",
       "      <td>872</td>\n",
       "      <td>1133</td>\n",
       "      <td>1394</td>\n",
       "      <td>1667</td>\n",
       "      <td>1928</td>\n",
       "      <td>2164</td>\n",
       "      <td>2463</td>\n",
       "      <td>2782</td>\n",
       "      <td>...</td>\n",
       "      <td>29410</td>\n",
       "      <td>30278</td>\n",
       "      <td>31248</td>\n",
       "      <td>32282</td>\n",
       "      <td>33227</td>\n",
       "      <td>33979</td>\n",
       "      <td>34654</td>\n",
       "      <td>35441</td>\n",
       "      <td>36115</td>\n",
       "      <td>37079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tomatoes</th>\n",
       "      <td>243</td>\n",
       "      <td>541</td>\n",
       "      <td>666</td>\n",
       "      <td>851</td>\n",
       "      <td>1135</td>\n",
       "      <td>1393</td>\n",
       "      <td>1614</td>\n",
       "      <td>2014</td>\n",
       "      <td>2281</td>\n",
       "      <td>2502</td>\n",
       "      <td>...</td>\n",
       "      <td>28325</td>\n",
       "      <td>28963</td>\n",
       "      <td>29604</td>\n",
       "      <td>30371</td>\n",
       "      <td>31008</td>\n",
       "      <td>32206</td>\n",
       "      <td>33143</td>\n",
       "      <td>34060</td>\n",
       "      <td>34728</td>\n",
       "      <td>36204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>milk</th>\n",
       "      <td>298</td>\n",
       "      <td>564</td>\n",
       "      <td>673</td>\n",
       "      <td>948</td>\n",
       "      <td>1114</td>\n",
       "      <td>1328</td>\n",
       "      <td>1503</td>\n",
       "      <td>1675</td>\n",
       "      <td>1892</td>\n",
       "      <td>2170</td>\n",
       "      <td>...</td>\n",
       "      <td>26783</td>\n",
       "      <td>27491</td>\n",
       "      <td>28578</td>\n",
       "      <td>29715</td>\n",
       "      <td>30374</td>\n",
       "      <td>30993</td>\n",
       "      <td>31640</td>\n",
       "      <td>32739</td>\n",
       "      <td>33497</td>\n",
       "      <td>34444</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>veggies</th>\n",
       "      <td>244</td>\n",
       "      <td>478</td>\n",
       "      <td>555</td>\n",
       "      <td>741</td>\n",
       "      <td>987</td>\n",
       "      <td>1188</td>\n",
       "      <td>1460</td>\n",
       "      <td>1663</td>\n",
       "      <td>1893</td>\n",
       "      <td>2212</td>\n",
       "      <td>...</td>\n",
       "      <td>27018</td>\n",
       "      <td>27609</td>\n",
       "      <td>28335</td>\n",
       "      <td>29444</td>\n",
       "      <td>30224</td>\n",
       "      <td>30901</td>\n",
       "      <td>31684</td>\n",
       "      <td>32415</td>\n",
       "      <td>33099</td>\n",
       "      <td>34102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>bread</th>\n",
       "      <td>286</td>\n",
       "      <td>486</td>\n",
       "      <td>572</td>\n",
       "      <td>742</td>\n",
       "      <td>1033</td>\n",
       "      <td>1253</td>\n",
       "      <td>1495</td>\n",
       "      <td>1646</td>\n",
       "      <td>1907</td>\n",
       "      <td>2072</td>\n",
       "      <td>...</td>\n",
       "      <td>25237</td>\n",
       "      <td>25949</td>\n",
       "      <td>26716</td>\n",
       "      <td>27491</td>\n",
       "      <td>28449</td>\n",
       "      <td>29163</td>\n",
       "      <td>29985</td>\n",
       "      <td>30748</td>\n",
       "      <td>31657</td>\n",
       "      <td>32814</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>spices</th>\n",
       "      <td>281</td>\n",
       "      <td>533</td>\n",
       "      <td>608</td>\n",
       "      <td>759</td>\n",
       "      <td>968</td>\n",
       "      <td>1169</td>\n",
       "      <td>1395</td>\n",
       "      <td>1658</td>\n",
       "      <td>1907</td>\n",
       "      <td>2105</td>\n",
       "      <td>...</td>\n",
       "      <td>25876</td>\n",
       "      <td>26682</td>\n",
       "      <td>27521</td>\n",
       "      <td>28487</td>\n",
       "      <td>29111</td>\n",
       "      <td>29942</td>\n",
       "      <td>30523</td>\n",
       "      <td>31327</td>\n",
       "      <td>31870</td>\n",
       "      <td>32784</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>fish</th>\n",
       "      <td>123</td>\n",
       "      <td>419</td>\n",
       "      <td>469</td>\n",
       "      <td>712</td>\n",
       "      <td>913</td>\n",
       "      <td>1131</td>\n",
       "      <td>1354</td>\n",
       "      <td>1475</td>\n",
       "      <td>1596</td>\n",
       "      <td>1853</td>\n",
       "      <td>...</td>\n",
       "      <td>24190</td>\n",
       "      <td>24546</td>\n",
       "      <td>25102</td>\n",
       "      <td>25819</td>\n",
       "      <td>26286</td>\n",
       "      <td>26898</td>\n",
       "      <td>27567</td>\n",
       "      <td>28261</td>\n",
       "      <td>28892</td>\n",
       "      <td>29713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>beans</th>\n",
       "      <td>278</td>\n",
       "      <td>433</td>\n",
       "      <td>521</td>\n",
       "      <td>599</td>\n",
       "      <td>774</td>\n",
       "      <td>944</td>\n",
       "      <td>1051</td>\n",
       "      <td>1206</td>\n",
       "      <td>1440</td>\n",
       "      <td>1673</td>\n",
       "      <td>...</td>\n",
       "      <td>21240</td>\n",
       "      <td>21845</td>\n",
       "      <td>22431</td>\n",
       "      <td>23090</td>\n",
       "      <td>23835</td>\n",
       "      <td>24300</td>\n",
       "      <td>25021</td>\n",
       "      <td>25757</td>\n",
       "      <td>26269</td>\n",
       "      <td>27318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pork</th>\n",
       "      <td>226</td>\n",
       "      <td>437</td>\n",
       "      <td>554</td>\n",
       "      <td>710</td>\n",
       "      <td>887</td>\n",
       "      <td>1014</td>\n",
       "      <td>1190</td>\n",
       "      <td>1374</td>\n",
       "      <td>1547</td>\n",
       "      <td>1774</td>\n",
       "      <td>...</td>\n",
       "      <td>21114</td>\n",
       "      <td>21595</td>\n",
       "      <td>22149</td>\n",
       "      <td>22916</td>\n",
       "      <td>23438</td>\n",
       "      <td>23979</td>\n",
       "      <td>24439</td>\n",
       "      <td>24952</td>\n",
       "      <td>25371</td>\n",
       "      <td>26147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>vegetables</th>\n",
       "      <td>189</td>\n",
       "      <td>401</td>\n",
       "      <td>473</td>\n",
       "      <td>614</td>\n",
       "      <td>804</td>\n",
       "      <td>934</td>\n",
       "      <td>1143</td>\n",
       "      <td>1295</td>\n",
       "      <td>1483</td>\n",
       "      <td>1674</td>\n",
       "      <td>...</td>\n",
       "      <td>19401</td>\n",
       "      <td>19808</td>\n",
       "      <td>20371</td>\n",
       "      <td>21172</td>\n",
       "      <td>21709</td>\n",
       "      <td>22292</td>\n",
       "      <td>22961</td>\n",
       "      <td>23479</td>\n",
       "      <td>23961</td>\n",
       "      <td>24739</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>stock</th>\n",
       "      <td>172</td>\n",
       "      <td>375</td>\n",
       "      <td>468</td>\n",
       "      <td>592</td>\n",
       "      <td>686</td>\n",
       "      <td>804</td>\n",
       "      <td>936</td>\n",
       "      <td>1029</td>\n",
       "      <td>1240</td>\n",
       "      <td>1451</td>\n",
       "      <td>...</td>\n",
       "      <td>18789</td>\n",
       "      <td>19425</td>\n",
       "      <td>19952</td>\n",
       "      <td>20585</td>\n",
       "      <td>21034</td>\n",
       "      <td>21568</td>\n",
       "      <td>22039</td>\n",
       "      <td>22570</td>\n",
       "      <td>22901</td>\n",
       "      <td>23392</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mushrooms</th>\n",
       "      <td>104</td>\n",
       "      <td>284</td>\n",
       "      <td>358</td>\n",
       "      <td>483</td>\n",
       "      <td>625</td>\n",
       "      <td>726</td>\n",
       "      <td>874</td>\n",
       "      <td>1012</td>\n",
       "      <td>1136</td>\n",
       "      <td>1390</td>\n",
       "      <td>...</td>\n",
       "      <td>16619</td>\n",
       "      <td>16970</td>\n",
       "      <td>17396</td>\n",
       "      <td>18055</td>\n",
       "      <td>18528</td>\n",
       "      <td>19064</td>\n",
       "      <td>19983</td>\n",
       "      <td>20591</td>\n",
       "      <td>21034</td>\n",
       "      <td>21861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cream</th>\n",
       "      <td>167</td>\n",
       "      <td>316</td>\n",
       "      <td>358</td>\n",
       "      <td>508</td>\n",
       "      <td>598</td>\n",
       "      <td>730</td>\n",
       "      <td>902</td>\n",
       "      <td>987</td>\n",
       "      <td>1142</td>\n",
       "      <td>1284</td>\n",
       "      <td>...</td>\n",
       "      <td>15624</td>\n",
       "      <td>16074</td>\n",
       "      <td>16543</td>\n",
       "      <td>17052</td>\n",
       "      <td>17436</td>\n",
       "      <td>17805</td>\n",
       "      <td>18224</td>\n",
       "      <td>18746</td>\n",
       "      <td>19166</td>\n",
       "      <td>19720</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>carrots</th>\n",
       "      <td>135</td>\n",
       "      <td>291</td>\n",
       "      <td>360</td>\n",
       "      <td>488</td>\n",
       "      <td>591</td>\n",
       "      <td>679</td>\n",
       "      <td>798</td>\n",
       "      <td>885</td>\n",
       "      <td>994</td>\n",
       "      <td>1281</td>\n",
       "      <td>...</td>\n",
       "      <td>15184</td>\n",
       "      <td>15531</td>\n",
       "      <td>15965</td>\n",
       "      <td>16432</td>\n",
       "      <td>17171</td>\n",
       "      <td>17865</td>\n",
       "      <td>18274</td>\n",
       "      <td>18696</td>\n",
       "      <td>19013</td>\n",
       "      <td>19469</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>soy sauce</th>\n",
       "      <td>80</td>\n",
       "      <td>234</td>\n",
       "      <td>300</td>\n",
       "      <td>415</td>\n",
       "      <td>535</td>\n",
       "      <td>661</td>\n",
       "      <td>787</td>\n",
       "      <td>893</td>\n",
       "      <td>974</td>\n",
       "      <td>1106</td>\n",
       "      <td>...</td>\n",
       "      <td>14983</td>\n",
       "      <td>15273</td>\n",
       "      <td>15716</td>\n",
       "      <td>16219</td>\n",
       "      <td>16714</td>\n",
       "      <td>17176</td>\n",
       "      <td>17547</td>\n",
       "      <td>18084</td>\n",
       "      <td>18479</td>\n",
       "      <td>18888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>vinegar</th>\n",
       "      <td>121</td>\n",
       "      <td>220</td>\n",
       "      <td>256</td>\n",
       "      <td>336</td>\n",
       "      <td>471</td>\n",
       "      <td>577</td>\n",
       "      <td>685</td>\n",
       "      <td>806</td>\n",
       "      <td>914</td>\n",
       "      <td>1028</td>\n",
       "      <td>...</td>\n",
       "      <td>13881</td>\n",
       "      <td>14186</td>\n",
       "      <td>14471</td>\n",
       "      <td>14834</td>\n",
       "      <td>15170</td>\n",
       "      <td>15588</td>\n",
       "      <td>15953</td>\n",
       "      <td>16449</td>\n",
       "      <td>16773</td>\n",
       "      <td>17373</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>turkey</th>\n",
       "      <td>60</td>\n",
       "      <td>103</td>\n",
       "      <td>126</td>\n",
       "      <td>168</td>\n",
       "      <td>219</td>\n",
       "      <td>258</td>\n",
       "      <td>285</td>\n",
       "      <td>361</td>\n",
       "      <td>405</td>\n",
       "      <td>538</td>\n",
       "      <td>...</td>\n",
       "      <td>13551</td>\n",
       "      <td>14925</td>\n",
       "      <td>15334</td>\n",
       "      <td>15641</td>\n",
       "      <td>15765</td>\n",
       "      <td>15883</td>\n",
       "      <td>16040</td>\n",
       "      <td>16239</td>\n",
       "      <td>16487</td>\n",
       "      <td>16755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mayo</th>\n",
       "      <td>93</td>\n",
       "      <td>162</td>\n",
       "      <td>181</td>\n",
       "      <td>234</td>\n",
       "      <td>424</td>\n",
       "      <td>520</td>\n",
       "      <td>589</td>\n",
       "      <td>668</td>\n",
       "      <td>714</td>\n",
       "      <td>763</td>\n",
       "      <td>...</td>\n",
       "      <td>12548</td>\n",
       "      <td>12798</td>\n",
       "      <td>13085</td>\n",
       "      <td>13521</td>\n",
       "      <td>13857</td>\n",
       "      <td>14201</td>\n",
       "      <td>14693</td>\n",
       "      <td>15292</td>\n",
       "      <td>15742</td>\n",
       "      <td>16323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tomato</th>\n",
       "      <td>118</td>\n",
       "      <td>236</td>\n",
       "      <td>267</td>\n",
       "      <td>342</td>\n",
       "      <td>480</td>\n",
       "      <td>578</td>\n",
       "      <td>676</td>\n",
       "      <td>798</td>\n",
       "      <td>891</td>\n",
       "      <td>1007</td>\n",
       "      <td>...</td>\n",
       "      <td>12507</td>\n",
       "      <td>12793</td>\n",
       "      <td>13070</td>\n",
       "      <td>13391</td>\n",
       "      <td>13707</td>\n",
       "      <td>14058</td>\n",
       "      <td>14436</td>\n",
       "      <td>14847</td>\n",
       "      <td>15160</td>\n",
       "      <td>15869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>salmon</th>\n",
       "      <td>45</td>\n",
       "      <td>155</td>\n",
       "      <td>174</td>\n",
       "      <td>252</td>\n",
       "      <td>318</td>\n",
       "      <td>389</td>\n",
       "      <td>492</td>\n",
       "      <td>564</td>\n",
       "      <td>640</td>\n",
       "      <td>723</td>\n",
       "      <td>...</td>\n",
       "      <td>11376</td>\n",
       "      <td>11572</td>\n",
       "      <td>11835</td>\n",
       "      <td>12211</td>\n",
       "      <td>12408</td>\n",
       "      <td>12689</td>\n",
       "      <td>13081</td>\n",
       "      <td>13306</td>\n",
       "      <td>13608</td>\n",
       "      <td>14323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>chili</th>\n",
       "      <td>140</td>\n",
       "      <td>240</td>\n",
       "      <td>277</td>\n",
       "      <td>327</td>\n",
       "      <td>400</td>\n",
       "      <td>444</td>\n",
       "      <td>484</td>\n",
       "      <td>560</td>\n",
       "      <td>715</td>\n",
       "      <td>829</td>\n",
       "      <td>...</td>\n",
       "      <td>11191</td>\n",
       "      <td>11579</td>\n",
       "      <td>11993</td>\n",
       "      <td>12431</td>\n",
       "      <td>12746</td>\n",
       "      <td>12984</td>\n",
       "      <td>13205</td>\n",
       "      <td>13548</td>\n",
       "      <td>13764</td>\n",
       "      <td>14293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cilantro</th>\n",
       "      <td>94</td>\n",
       "      <td>189</td>\n",
       "      <td>224</td>\n",
       "      <td>305</td>\n",
       "      <td>379</td>\n",
       "      <td>471</td>\n",
       "      <td>559</td>\n",
       "      <td>652</td>\n",
       "      <td>742</td>\n",
       "      <td>820</td>\n",
       "      <td>...</td>\n",
       "      <td>11081</td>\n",
       "      <td>11294</td>\n",
       "      <td>11517</td>\n",
       "      <td>11808</td>\n",
       "      <td>12102</td>\n",
       "      <td>12344</td>\n",
       "      <td>13179</td>\n",
       "      <td>13485</td>\n",
       "      <td>13733</td>\n",
       "      <td>14050</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>noodles</th>\n",
       "      <td>100</td>\n",
       "      <td>244</td>\n",
       "      <td>308</td>\n",
       "      <td>360</td>\n",
       "      <td>425</td>\n",
       "      <td>503</td>\n",
       "      <td>574</td>\n",
       "      <td>644</td>\n",
       "      <td>718</td>\n",
       "      <td>829</td>\n",
       "      <td>...</td>\n",
       "      <td>10547</td>\n",
       "      <td>10850</td>\n",
       "      <td>11422</td>\n",
       "      <td>11819</td>\n",
       "      <td>12077</td>\n",
       "      <td>12325</td>\n",
       "      <td>12598</td>\n",
       "      <td>12900</td>\n",
       "      <td>13249</td>\n",
       "      <td>13618</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>corn</th>\n",
       "      <td>77</td>\n",
       "      <td>156</td>\n",
       "      <td>177</td>\n",
       "      <td>230</td>\n",
       "      <td>350</td>\n",
       "      <td>456</td>\n",
       "      <td>578</td>\n",
       "      <td>663</td>\n",
       "      <td>756</td>\n",
       "      <td>812</td>\n",
       "      <td>...</td>\n",
       "      <td>9834</td>\n",
       "      <td>10261</td>\n",
       "      <td>10460</td>\n",
       "      <td>10702</td>\n",
       "      <td>10909</td>\n",
       "      <td>11233</td>\n",
       "      <td>11591</td>\n",
       "      <td>11946</td>\n",
       "      <td>12332</td>\n",
       "      <td>13072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>broccoli</th>\n",
       "      <td>86</td>\n",
       "      <td>165</td>\n",
       "      <td>185</td>\n",
       "      <td>228</td>\n",
       "      <td>304</td>\n",
       "      <td>342</td>\n",
       "      <td>448</td>\n",
       "      <td>513</td>\n",
       "      <td>583</td>\n",
       "      <td>679</td>\n",
       "      <td>...</td>\n",
       "      <td>9367</td>\n",
       "      <td>9519</td>\n",
       "      <td>9766</td>\n",
       "      <td>10184</td>\n",
       "      <td>10445</td>\n",
       "      <td>10778</td>\n",
       "      <td>11159</td>\n",
       "      <td>11447</td>\n",
       "      <td>11743</td>\n",
       "      <td>12130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ham</th>\n",
       "      <td>67</td>\n",
       "      <td>103</td>\n",
       "      <td>128</td>\n",
       "      <td>239</td>\n",
       "      <td>290</td>\n",
       "      <td>346</td>\n",
       "      <td>397</td>\n",
       "      <td>431</td>\n",
       "      <td>482</td>\n",
       "      <td>552</td>\n",
       "      <td>...</td>\n",
       "      <td>8155</td>\n",
       "      <td>8413</td>\n",
       "      <td>8903</td>\n",
       "      <td>9166</td>\n",
       "      <td>9355</td>\n",
       "      <td>9592</td>\n",
       "      <td>9940</td>\n",
       "      <td>10106</td>\n",
       "      <td>10344</td>\n",
       "      <td>10888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ketchup</th>\n",
       "      <td>60</td>\n",
       "      <td>121</td>\n",
       "      <td>136</td>\n",
       "      <td>175</td>\n",
       "      <td>428</td>\n",
       "      <td>493</td>\n",
       "      <td>534</td>\n",
       "      <td>582</td>\n",
       "      <td>605</td>\n",
       "      <td>659</td>\n",
       "      <td>...</td>\n",
       "      <td>7408</td>\n",
       "      <td>7609</td>\n",
       "      <td>7894</td>\n",
       "      <td>8327</td>\n",
       "      <td>8548</td>\n",
       "      <td>8695</td>\n",
       "      <td>9000</td>\n",
       "      <td>9444</td>\n",
       "      <td>9857</td>\n",
       "      <td>10283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tofu</th>\n",
       "      <td>45</td>\n",
       "      <td>89</td>\n",
       "      <td>102</td>\n",
       "      <td>143</td>\n",
       "      <td>256</td>\n",
       "      <td>331</td>\n",
       "      <td>399</td>\n",
       "      <td>445</td>\n",
       "      <td>508</td>\n",
       "      <td>576</td>\n",
       "      <td>...</td>\n",
       "      <td>7181</td>\n",
       "      <td>7485</td>\n",
       "      <td>7603</td>\n",
       "      <td>7917</td>\n",
       "      <td>8472</td>\n",
       "      <td>8791</td>\n",
       "      <td>9003</td>\n",
       "      <td>9176</td>\n",
       "      <td>9346</td>\n",
       "      <td>9915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>lamb</th>\n",
       "      <td>39</td>\n",
       "      <td>109</td>\n",
       "      <td>138</td>\n",
       "      <td>175</td>\n",
       "      <td>235</td>\n",
       "      <td>287</td>\n",
       "      <td>317</td>\n",
       "      <td>366</td>\n",
       "      <td>413</td>\n",
       "      <td>506</td>\n",
       "      <td>...</td>\n",
       "      <td>5155</td>\n",
       "      <td>5224</td>\n",
       "      <td>5406</td>\n",
       "      <td>6455</td>\n",
       "      <td>6575</td>\n",
       "      <td>6691</td>\n",
       "      <td>6834</td>\n",
       "      <td>6943</td>\n",
       "      <td>7091</td>\n",
       "      <td>7263</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>olives</th>\n",
       "      <td>17</td>\n",
       "      <td>55</td>\n",
       "      <td>67</td>\n",
       "      <td>84</td>\n",
       "      <td>112</td>\n",
       "      <td>131</td>\n",
       "      <td>165</td>\n",
       "      <td>176</td>\n",
       "      <td>203</td>\n",
       "      <td>234</td>\n",
       "      <td>...</td>\n",
       "      <td>3206</td>\n",
       "      <td>3284</td>\n",
       "      <td>3437</td>\n",
       "      <td>3569</td>\n",
       "      <td>3689</td>\n",
       "      <td>3778</td>\n",
       "      <td>4300</td>\n",
       "      <td>4462</td>\n",
       "      <td>4578</td>\n",
       "      <td>4730</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>okra</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>10</td>\n",
       "      <td>17</td>\n",
       "      <td>19</td>\n",
       "      <td>37</td>\n",
       "      <td>46</td>\n",
       "      <td>49</td>\n",
       "      <td>53</td>\n",
       "      <td>...</td>\n",
       "      <td>1388</td>\n",
       "      <td>1441</td>\n",
       "      <td>1499</td>\n",
       "      <td>1604</td>\n",
       "      <td>1616</td>\n",
       "      <td>1676</td>\n",
       "      <td>1959</td>\n",
       "      <td>1991</td>\n",
       "      <td>2038</td>\n",
       "      <td>2255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>grits</th>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>12</td>\n",
       "      <td>16</td>\n",
       "      <td>41</td>\n",
       "      <td>49</td>\n",
       "      <td>58</td>\n",
       "      <td>70</td>\n",
       "      <td>126</td>\n",
       "      <td>130</td>\n",
       "      <td>...</td>\n",
       "      <td>1525</td>\n",
       "      <td>1558</td>\n",
       "      <td>1583</td>\n",
       "      <td>1611</td>\n",
       "      <td>1681</td>\n",
       "      <td>1700</td>\n",
       "      <td>1726</td>\n",
       "      <td>1759</td>\n",
       "      <td>1785</td>\n",
       "      <td>2066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>turkeys</th>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>17</td>\n",
       "      <td>23</td>\n",
       "      <td>33</td>\n",
       "      <td>...</td>\n",
       "      <td>1089</td>\n",
       "      <td>1196</td>\n",
       "      <td>1216</td>\n",
       "      <td>1229</td>\n",
       "      <td>1237</td>\n",
       "      <td>1249</td>\n",
       "      <td>1260</td>\n",
       "      <td>1270</td>\n",
       "      <td>1281</td>\n",
       "      <td>1293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cranberry sauce</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>15</td>\n",
       "      <td>20</td>\n",
       "      <td>27</td>\n",
       "      <td>...</td>\n",
       "      <td>887</td>\n",
       "      <td>990</td>\n",
       "      <td>1026</td>\n",
       "      <td>1038</td>\n",
       "      <td>1045</td>\n",
       "      <td>1049</td>\n",
       "      <td>1061</td>\n",
       "      <td>1080</td>\n",
       "      <td>1123</td>\n",
       "      <td>1133</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>catfish</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>11</td>\n",
       "      <td>22</td>\n",
       "      <td>22</td>\n",
       "      <td>29</td>\n",
       "      <td>36</td>\n",
       "      <td>...</td>\n",
       "      <td>647</td>\n",
       "      <td>655</td>\n",
       "      <td>661</td>\n",
       "      <td>677</td>\n",
       "      <td>690</td>\n",
       "      <td>697</td>\n",
       "      <td>712</td>\n",
       "      <td>732</td>\n",
       "      <td>755</td>\n",
       "      <td>999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sheep</th>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>12</td>\n",
       "      <td>17</td>\n",
       "      <td>18</td>\n",
       "      <td>18</td>\n",
       "      <td>21</td>\n",
       "      <td>22</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>352</td>\n",
       "      <td>359</td>\n",
       "      <td>366</td>\n",
       "      <td>564</td>\n",
       "      <td>576</td>\n",
       "      <td>597</td>\n",
       "      <td>606</td>\n",
       "      <td>609</td>\n",
       "      <td>628</td>\n",
       "      <td>645</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pork roll</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>160</td>\n",
       "      <td>165</td>\n",
       "      <td>166</td>\n",
       "      <td>166</td>\n",
       "      <td>167</td>\n",
       "      <td>184</td>\n",
       "      <td>184</td>\n",
       "      <td>187</td>\n",
       "      <td>194</td>\n",
       "      <td>351</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>avocado toast</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>102</td>\n",
       "      <td>104</td>\n",
       "      <td>112</td>\n",
       "      <td>120</td>\n",
       "      <td>128</td>\n",
       "      <td>134</td>\n",
       "      <td>147</td>\n",
       "      <td>157</td>\n",
       "      <td>164</td>\n",
       "      <td>285</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>italian beef</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>89</td>\n",
       "      <td>90</td>\n",
       "      <td>93</td>\n",
       "      <td>94</td>\n",
       "      <td>95</td>\n",
       "      <td>100</td>\n",
       "      <td>101</td>\n",
       "      <td>103</td>\n",
       "      <td>106</td>\n",
       "      <td>221</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>funeral potatoes</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>51</td>\n",
       "      <td>60</td>\n",
       "      <td>62</td>\n",
       "      <td>62</td>\n",
       "      <td>63</td>\n",
       "      <td>67</td>\n",
       "      <td>69</td>\n",
       "      <td>69</td>\n",
       "      <td>70</td>\n",
       "      <td>204</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>50 rows × 91 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  2012-01  2012-02  2012-03  2012-04  2012-05  2012-06  \\\n",
       "Term                                                                     \n",
       "potatoes              343      654      773      963     1194     1402   \n",
       "onions                330      657      796     1076     1540     1850   \n",
       "bacon                 439      799      983     1325     1818     2237   \n",
       "pasta                 451      679      763     1054     1361     1648   \n",
       "beef                  285      631      765     1089     1314     1550   \n",
       "egg                   302      566      700      914     1261     1500   \n",
       "olive oil             348      698      796     1108     1433     1759   \n",
       "onion                 307      622      718      957     1296     1589   \n",
       "steak                 357      785      915     1235     1485     1701   \n",
       "sugar                 312      588      730      985     1288     1545   \n",
       "flour                 435      765      872     1133     1394     1667   \n",
       "tomatoes              243      541      666      851     1135     1393   \n",
       "milk                  298      564      673      948     1114     1328   \n",
       "veggies               244      478      555      741      987     1188   \n",
       "bread                 286      486      572      742     1033     1253   \n",
       "spices                281      533      608      759      968     1169   \n",
       "fish                  123      419      469      712      913     1131   \n",
       "beans                 278      433      521      599      774      944   \n",
       "pork                  226      437      554      710      887     1014   \n",
       "vegetables            189      401      473      614      804      934   \n",
       "stock                 172      375      468      592      686      804   \n",
       "mushrooms             104      284      358      483      625      726   \n",
       "cream                 167      316      358      508      598      730   \n",
       "carrots               135      291      360      488      591      679   \n",
       "soy sauce              80      234      300      415      535      661   \n",
       "vinegar               121      220      256      336      471      577   \n",
       "turkey                 60      103      126      168      219      258   \n",
       "mayo                   93      162      181      234      424      520   \n",
       "tomato                118      236      267      342      480      578   \n",
       "salmon                 45      155      174      252      318      389   \n",
       "chili                 140      240      277      327      400      444   \n",
       "cilantro               94      189      224      305      379      471   \n",
       "noodles               100      244      308      360      425      503   \n",
       "corn                   77      156      177      230      350      456   \n",
       "broccoli               86      165      185      228      304      342   \n",
       "ham                    67      103      128      239      290      346   \n",
       "ketchup                60      121      136      175      428      493   \n",
       "tofu                   45       89      102      143      256      331   \n",
       "lamb                   39      109      138      175      235      287   \n",
       "olives                 17       55       67       84      112      131   \n",
       "okra                    1        4        6       10       17       19   \n",
       "grits                   5       10       12       16       41       49   \n",
       "turkeys                 1        5        7       10       10       10   \n",
       "cranberry sauce         1        2        2        3        5        7   \n",
       "catfish                 3        4        4        9        9       11   \n",
       "sheep                   9        9       10       12       17       18   \n",
       "pork roll               0        0        0        0        0        0   \n",
       "avocado toast           0        0        0        0        0        0   \n",
       "italian beef            0        0        0        0        1        1   \n",
       "funeral potatoes        1        1        1        1        1        1   \n",
       "\n",
       "                  2012-07  2012-08  2012-09  2012-10  ...  2018-10  2018-11  \\\n",
       "Term                                                  ...                     \n",
       "potatoes             1610     1905     2168     2568  ...    37277    38479   \n",
       "onions               2201     2510     2829     3176  ...    35786    36703   \n",
       "bacon                2766     3109     3495     3914  ...    35680    36357   \n",
       "pasta                2016     2284     2534     3058  ...    33008    34048   \n",
       "beef                 1785     2056     2258     2638  ...    30900    31667   \n",
       "egg                  1777     2036     2334     2614  ...    30880    31433   \n",
       "olive oil            2097     2399     2713     3045  ...    31935    32580   \n",
       "onion                1862     2130     2433     2818  ...    31212    32048   \n",
       "steak                1967     2339     2591     2935  ...    31193    31671   \n",
       "sugar                1836     2085     2332     2614  ...    30231    30965   \n",
       "flour                1928     2164     2463     2782  ...    29410    30278   \n",
       "tomatoes             1614     2014     2281     2502  ...    28325    28963   \n",
       "milk                 1503     1675     1892     2170  ...    26783    27491   \n",
       "veggies              1460     1663     1893     2212  ...    27018    27609   \n",
       "bread                1495     1646     1907     2072  ...    25237    25949   \n",
       "spices               1395     1658     1907     2105  ...    25876    26682   \n",
       "fish                 1354     1475     1596     1853  ...    24190    24546   \n",
       "beans                1051     1206     1440     1673  ...    21240    21845   \n",
       "pork                 1190     1374     1547     1774  ...    21114    21595   \n",
       "vegetables           1143     1295     1483     1674  ...    19401    19808   \n",
       "stock                 936     1029     1240     1451  ...    18789    19425   \n",
       "mushrooms             874     1012     1136     1390  ...    16619    16970   \n",
       "cream                 902      987     1142     1284  ...    15624    16074   \n",
       "carrots               798      885      994     1281  ...    15184    15531   \n",
       "soy sauce             787      893      974     1106  ...    14983    15273   \n",
       "vinegar               685      806      914     1028  ...    13881    14186   \n",
       "turkey                285      361      405      538  ...    13551    14925   \n",
       "mayo                  589      668      714      763  ...    12548    12798   \n",
       "tomato                676      798      891     1007  ...    12507    12793   \n",
       "salmon                492      564      640      723  ...    11376    11572   \n",
       "chili                 484      560      715      829  ...    11191    11579   \n",
       "cilantro              559      652      742      820  ...    11081    11294   \n",
       "noodles               574      644      718      829  ...    10547    10850   \n",
       "corn                  578      663      756      812  ...     9834    10261   \n",
       "broccoli              448      513      583      679  ...     9367     9519   \n",
       "ham                   397      431      482      552  ...     8155     8413   \n",
       "ketchup               534      582      605      659  ...     7408     7609   \n",
       "tofu                  399      445      508      576  ...     7181     7485   \n",
       "lamb                  317      366      413      506  ...     5155     5224   \n",
       "olives                165      176      203      234  ...     3206     3284   \n",
       "okra                   37       46       49       53  ...     1388     1441   \n",
       "grits                  58       70      126      130  ...     1525     1558   \n",
       "turkeys                11       17       23       33  ...     1089     1196   \n",
       "cranberry sauce         8       15       20       27  ...      887      990   \n",
       "catfish                22       22       29       36  ...      647      655   \n",
       "sheep                  18       21       22       24  ...      352      359   \n",
       "pork roll               2        2        2        3  ...      160      165   \n",
       "avocado toast           0        0        0        0  ...      102      104   \n",
       "italian beef            2        2        3        4  ...       89       90   \n",
       "funeral potatoes        1        1        1        1  ...       51       60   \n",
       "\n",
       "                  2018-12  2019-01  2019-02  2019-03  2019-04  2019-05  \\\n",
       "Term                                                                     \n",
       "potatoes            39734    41033    42277    43420    44668    45723   \n",
       "onions              37557    39298    40462    41567    42691    43967   \n",
       "bacon               37514    38969    39708    40429    41128    42064   \n",
       "pasta               35010    36387    37512    38363    39412    40591   \n",
       "beef                32631    33804    34735    35566    36499    37372   \n",
       "egg                 32313    33304    34125    34921    35955    36997   \n",
       "olive oil           33199    34114    35131    35882    36704    37486   \n",
       "onion               32832    34037    34811    35594    36292    37255   \n",
       "steak               32579    33593    34361    35021    35962    36693   \n",
       "sugar               31997    32912    33689    34684    35355    36315   \n",
       "flour               31248    32282    33227    33979    34654    35441   \n",
       "tomatoes            29604    30371    31008    32206    33143    34060   \n",
       "milk                28578    29715    30374    30993    31640    32739   \n",
       "veggies             28335    29444    30224    30901    31684    32415   \n",
       "bread               26716    27491    28449    29163    29985    30748   \n",
       "spices              27521    28487    29111    29942    30523    31327   \n",
       "fish                25102    25819    26286    26898    27567    28261   \n",
       "beans               22431    23090    23835    24300    25021    25757   \n",
       "pork                22149    22916    23438    23979    24439    24952   \n",
       "vegetables          20371    21172    21709    22292    22961    23479   \n",
       "stock               19952    20585    21034    21568    22039    22570   \n",
       "mushrooms           17396    18055    18528    19064    19983    20591   \n",
       "cream               16543    17052    17436    17805    18224    18746   \n",
       "carrots             15965    16432    17171    17865    18274    18696   \n",
       "soy sauce           15716    16219    16714    17176    17547    18084   \n",
       "vinegar             14471    14834    15170    15588    15953    16449   \n",
       "turkey              15334    15641    15765    15883    16040    16239   \n",
       "mayo                13085    13521    13857    14201    14693    15292   \n",
       "tomato              13070    13391    13707    14058    14436    14847   \n",
       "salmon              11835    12211    12408    12689    13081    13306   \n",
       "chili               11993    12431    12746    12984    13205    13548   \n",
       "cilantro            11517    11808    12102    12344    13179    13485   \n",
       "noodles             11422    11819    12077    12325    12598    12900   \n",
       "corn                10460    10702    10909    11233    11591    11946   \n",
       "broccoli             9766    10184    10445    10778    11159    11447   \n",
       "ham                  8903     9166     9355     9592     9940    10106   \n",
       "ketchup              7894     8327     8548     8695     9000     9444   \n",
       "tofu                 7603     7917     8472     8791     9003     9176   \n",
       "lamb                 5406     6455     6575     6691     6834     6943   \n",
       "olives               3437     3569     3689     3778     4300     4462   \n",
       "okra                 1499     1604     1616     1676     1959     1991   \n",
       "grits                1583     1611     1681     1700     1726     1759   \n",
       "turkeys              1216     1229     1237     1249     1260     1270   \n",
       "cranberry sauce      1026     1038     1045     1049     1061     1080   \n",
       "catfish               661      677      690      697      712      732   \n",
       "sheep                 366      564      576      597      606      609   \n",
       "pork roll             166      166      167      184      184      187   \n",
       "avocado toast         112      120      128      134      147      157   \n",
       "italian beef           93       94       95      100      101      103   \n",
       "funeral potatoes       62       62       63       67       69       69   \n",
       "\n",
       "                  2019-06  2019-07  \n",
       "Term                                \n",
       "potatoes            46768    48460  \n",
       "onions              44759    46478  \n",
       "bacon               42798    43857  \n",
       "pasta               41829    43308  \n",
       "beef                38180    39423  \n",
       "egg                 37758    39253  \n",
       "olive oil           38133    39157  \n",
       "onion               37930    39118  \n",
       "steak               37490    38871  \n",
       "sugar               37200    38423  \n",
       "flour               36115    37079  \n",
       "tomatoes            34728    36204  \n",
       "milk                33497    34444  \n",
       "veggies             33099    34102  \n",
       "bread               31657    32814  \n",
       "spices              31870    32784  \n",
       "fish                28892    29713  \n",
       "beans               26269    27318  \n",
       "pork                25371    26147  \n",
       "vegetables          23961    24739  \n",
       "stock               22901    23392  \n",
       "mushrooms           21034    21861  \n",
       "cream               19166    19720  \n",
       "carrots             19013    19469  \n",
       "soy sauce           18479    18888  \n",
       "vinegar             16773    17373  \n",
       "turkey              16487    16755  \n",
       "mayo                15742    16323  \n",
       "tomato              15160    15869  \n",
       "salmon              13608    14323  \n",
       "chili               13764    14293  \n",
       "cilantro            13733    14050  \n",
       "noodles             13249    13618  \n",
       "corn                12332    13072  \n",
       "broccoli            11743    12130  \n",
       "ham                 10344    10888  \n",
       "ketchup              9857    10283  \n",
       "tofu                 9346     9915  \n",
       "lamb                 7091     7263  \n",
       "olives               4578     4730  \n",
       "okra                 2038     2255  \n",
       "grits                1785     2066  \n",
       "turkeys              1281     1293  \n",
       "cranberry sauce      1123     1133  \n",
       "catfish               755      999  \n",
       "sheep                 628      645  \n",
       "pork roll             194      351  \n",
       "avocado toast         164      285  \n",
       "italian beef          106      221  \n",
       "funeral potatoes       70      204  \n",
       "\n",
       "[50 rows x 91 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "SUBSET = drop_most_frequent(DF, DROP_MOST_FREQUENT)\n",
    "SUBSET = get_most_variant(SUBSET, N_TOTAL, mean_weight=True)[:200]\n",
    "SUBSET = sort_by_frequency(SUBSET)\n",
    "SUBSET = SUBSET.cumsum(axis=1)\n",
    "SUBSET"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "SUBSET.to_csv(OUTPUT_FILE)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}